package chapter4;
import java.util.Scanner;
/****************************************************************
 * Author：icynlau
 * Description:  求正五边形顶点坐标
 * 				使用到了exc4_6的方法，通过(r*cosα，r*sinα)确定点的坐标；
 * Date:2021/4/2
 * ***************************************************************
 */
public class exc4_7 {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in);
		System.out.print("Enter the radius of the bounding circle: ");
		double r=input.nextDouble();
		System.out.println("The coordinates of five points on the pentagon are: ");
		//从PI/2开始
		double radians=Math.PI/2;
		for(int i=0;i<5;i++) {
			System.out.printf("( %.5f  ,  %.5f )\n",r*Math.cos(radians),r*Math.sin(radians) );
			radians+=(2*Math.PI)/5;
		}
		
		
	}

}
